package cn.xydpeng.springframework.beans.factory.support;

import cn.xydpeng.springframework.beans.BeansException;
import cn.xydpeng.springframework.beans.factory.BeanFactory;
import cn.xydpeng.springframework.lang.Nullable;

import java.lang.reflect.Constructor;

/**
 * @author xydpeng
 * @version v1.0
 * @date: 2022/10/12
 * @description: 实例化对象策略
 */
public interface InstantiationStrategy {

    Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner)
            throws BeansException;


    Object instantiate(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner,
                       Constructor<?> ctor, Object... args) throws BeansException;

}
